import {Component,OnInit} from '@angular/core';
import {ActivatedRoute} from "@angular/router";
import {AuthService} from "../service/auth.service";
import {User} from "../entity/user";

@Component({
    moduleId: module.id,
    selector: 'my-back',
    templateUrl: 'back.component.html',
    styleUrls: ['back.component.css'],
})

export class BackComponent implements OnInit{

  constructor( private route: ActivatedRoute, private authService:AuthService){}

  isCollapseOne:boolean = false;
  isCollapseTwo:boolean = false;
  isCollapseThere:boolean = false;
  currentUser:User;

  ngOnInit(): void {
    this.authService.currentUser().subscribe(currentUser => this.currentUser = currentUser);
  }

  show_bs_collapse(isActive:string):void {
    if(isActive === "isCollapseOne"){
      this.isCollapseOne = !this.isCollapseOne;
    }else if(isActive === "isCollapseTwo"){
      this.isCollapseTwo = !this.isCollapseTwo;
    }else{
      this.isCollapseThere = !this.isCollapseThere;
    }

  }
}
